package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;
                                                                                            import com.ruoyi.common.utils.DateUtils;
            import org.springframework.stereotype.Service;
    import com.ruoyi.bizsys.mapper.BatchJobMonitoringMapper;
import com.ruoyi.bizsys.domain.BatchJobMonitoring;
import com.ruoyi.bizsys.service.IBatchJobMonitoringService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 跑批日切管理Service业务层处理
 *
 * @author african-loan
 * @date 2021-12-30
 */
@Service
public class BatchJobMonitoringServiceImpl extends ServiceImpl<BatchJobMonitoringMapper,BatchJobMonitoring> implements IBatchJobMonitoringService {

    /**
     * 查询跑批日切管理
     *
     * @param id 跑批日切管理ID
     * @return 跑批日切管理
     */
    @Override
    public BatchJobMonitoring selectBatchJobMonitoringById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询跑批日切管理列表
     *
     * @param batchJobMonitoring 跑批日切管理
     * @return 跑批日切管理
     */
    @Override
    public List<BatchJobMonitoring> selectBatchJobMonitoringList(BatchJobMonitoring batchJobMonitoring) {
        return this.list(new QueryWrapper<>(batchJobMonitoring).last("order by id desc"));
    }

    /**
     * 新增跑批日切管理
     *
     * @param batchJobMonitoring 跑批日切管理
     * @return 结果
     */
            @Override
    public int insertBatchJobMonitoring(BatchJobMonitoring batchJobMonitoring) {
                                                                                                                                                            batchJobMonitoring.setCreateTime(DateUtils.getNowDate());
                                                return baseMapper.insert(batchJobMonitoring);
    }

    /**
     * 修改跑批日切管理
     *
     * @param batchJobMonitoring 跑批日切管理
     * @return 结果
     */
            @Override
    public int updateBatchJobMonitoring(BatchJobMonitoring batchJobMonitoring) {
                                                                                                                                                                                batchJobMonitoring.setUpdateTime(DateUtils.getNowDate());
                            return baseMapper.updateById(batchJobMonitoring);
    }

    /**
     * 批量删除跑批日切管理
     *
     * @param ids 需要删除的跑批日切管理ID
     * @return 结果
     */
            @Override
    public int deleteBatchJobMonitoringByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除跑批日切管理信息
     *
     * @param id 跑批日切管理ID
     * @return 结果
     */
    @Override
    public int deleteBatchJobMonitoringById(Long id) {
        return baseMapper.deleteById(id);
    }

}
